@extends('layouts.admin.application')

@section('css')
    <link rel="stylesheet" href="/ace/assets/css/datepicker.css">
@endsection

@section('content')
    <div class="main-content">
        <div class="col-xs-12">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="#">首页</a></li>
                    <li><a href="{{ route('cashier.allocation.index') }}">库存调拨</a></li>
                    <li class="active">编辑调拨单</li>
                </ul>
            </div>

            @include('layouts.partials._flash')

            <form class="form-horizontal" role="form" action="{{ route('cashier.allocation.update', $allocation->id) }}"
                  method="post"
                  style="margin-top: 20px;">

                {{csrf_field()}}
                {{ method_field('PUT') }}

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">单据编号：</label>

                    <div class="col-sm-9">
                        <input type="text" name="number" value="{{$allocation->number}}" class="col-xs-10 col-sm-5">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">商品条码：</label>

                    <div class="col-sm-9">
                        <input type="text" name="code" value="{{$allocation->code}}" class="col-xs-10 col-sm-5">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">出库店铺：</label>

                    <div class="col-sm-9">
                        <select class="col-xs-10 col-sm-5" name="out_store">
                            <option value="0">请选择</option>
                            @foreach($stores as $store)
                                <option value="{{$store->id}}"
                                        @if($store->id == $allocation->out_store) selected @endif>
                                    {{$store->name}}
                                </option>
                            @endforeach
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">入库店铺：</label>

                    <div class="col-sm-9">
                        <select class="col-xs-10 col-sm-5" name="in_store">
                            <option value="0">请选择</option>
                            @foreach($stores as $store)
                                <option value="{{$store->id}}"
                                        @if($store->id == $allocation->in_store) selected @endif>
                                    {{$store->name}}
                                </option>
                            @endforeach
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">经手人：</label>

                    <div class="col-sm-9">
                        <input type="text" name="handle_person" value="{{$allocation->handle_person}}"
                               class="col-xs-10 col-sm-5">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">商品单价：</label>

                    <div class="col-sm-9">
                        <input type="text" name="price" value="{{$allocation->price}}" class="col-xs-10 col-sm-5">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">商品数量：</label>

                    <div class="col-sm-9">
                        <input type="text" name="num" value="{{$allocation->num}}" class="col-xs-10 col-sm-5">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">制单人：</label>

                    <div class="col-sm-9">
                        <input type="text" name="touch_person" value="{{$allocation->touch_person}}"
                               class="col-xs-10 col-sm-5">
                    </div>
                </div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="submit"><i class="icon-ok bigger-110"></i>保存</button>
                        &nbsp; &nbsp; &nbsp;
                        <a class="btn" onclick="javascript:history.back(-1);return false;">
                            <i class="icon-undo bigger-110"></i>返回</a>
                    </div>
                </div>
            </form>
        </div>

    </div>
@endsection
